/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.com.ces4.produccion.jpa.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author usuario
 */
@Embeddable
public class MateriaPrimaArticuloPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "DSARTICULO", nullable = false, length = 20)
    private String dsarticulo;
    @Basic(optional = false)
    @Column(name = "NMMATERIA_PRIMA", nullable = false)
    private int nmmateriaPrima;

    public MateriaPrimaArticuloPK() {
    }

    public MateriaPrimaArticuloPK(String dsarticulo, int nmmateriaPrima) {
        this.dsarticulo = dsarticulo;
        this.nmmateriaPrima = nmmateriaPrima;
    }

    public String getDsarticulo() {
        return dsarticulo;
    }

    public void setDsarticulo(String dsarticulo) {
        this.dsarticulo = dsarticulo;
    }

    public int getNmmateriaPrima() {
        return nmmateriaPrima;
    }

    public void setNmmateriaPrima(int nmmateriaPrima) {
        this.nmmateriaPrima = nmmateriaPrima;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (dsarticulo != null ? dsarticulo.hashCode() : 0);
        hash += (int) nmmateriaPrima;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MateriaPrimaArticuloPK)) {
            return false;
        }
        MateriaPrimaArticuloPK other = (MateriaPrimaArticuloPK) object;
        if ((this.dsarticulo == null && other.dsarticulo != null) || (this.dsarticulo != null && !this.dsarticulo.equals(other.dsarticulo))) {
            return false;
        }
        if (this.nmmateriaPrima != other.nmmateriaPrima) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "co.com.ces4.produccion.jpa.entities.MateriaPrimaArticuloPK[ dsarticulo=" + dsarticulo + ", nmmateriaPrima=" + nmmateriaPrima + " ]";
    }
    
}
